home *** CD-ROM | disk | FTP | other *** search
/ Chip: 2005 Utilities / CHIP Utilities 2005.7z / CHIP Utilities 2005.iso / CHIP Utilities / Zarzadzanie i bezpieczenstwo systemu / MBSA / MBSASetup-EN.msi / Data.Cab / report.xsl < prev    next >
Extensible Markup Language  |  2004-08-13  |  23KB  |  566 lines

  1. <?xml version="1.0"?> 
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.  
  4.     <xsl:variable name="ScoreLookup">
  5.       <c score="0" url="Graphics/dash.gif" alttext="Check Not Performed"/>
  6.       <c score="1" url="Graphics/excl_red.gif" alttext="Unable to scan"/>
  7.       <c score="2" url="Graphics/x_red.gif" alttext="Check failed (critical)"/>
  8.       <c score="3" url="Graphics/x_gold.gif" alttext="Check failed (non-critical)"/>
  9.       <c score="4" url="Graphics/astrx.gif" alttext="Best practice"/>
  10.       <c score="5" url="Graphics/chek_grn.gif" alttext="Check passed"/>
  11.       <c score="6" url="Graphics/dash.gif" alttext="Check not performed"/>
  12.       <c score="7" url="Graphics/info.gif" alttext="Additional information"/>
  13.  
  14.     </xsl:variable>
  15.     
  16.     <xsl:variable name="Assessment">
  17.       <c score="1" text="Incomplete Scan" longtext="Could not complete one or more requested checks."/>
  18.       <c score="2" text="Severe Risk" longtext="One or more critical checks failed."/>
  19.       <c score="3" text="Potential Risk" longtext="One or more non-critical checks failed."/>
  20.       <c score="4" text="Security FYIs" longtext=""/>
  21.       <c score="5" text="Strong Security" longtext="All checks were passed."/>
  22.     </xsl:variable>
  23.  
  24.     <xsl:variable name="FileName"></xsl:variable>
  25.     
  26.     <!-- The outermost tag -->
  27.     <xsl:template match="SecScan">
  28.  
  29.         <!-- Add the report header information in a table -->
  30.         <xsl:param name="assess" select="@Grade"/>    
  31.         <table>
  32.         <tr>
  33.             <td class="reportsubheader" width="200">Computer name:</td>
  34.             <td>
  35.                 <xsl:choose>
  36.                     <xsl:when test="@DisplayName">
  37.                         <xsl:value-of select="@DisplayName"/>
  38.                     </xsl:when>
  39.                     <xsl:otherwise>
  40.                         <xsl:value-of select="@Domain"/>\<xsl:value-of select="@Machine"/>
  41.                     </xsl:otherwise>
  42.                 </xsl:choose>
  43.             </td>
  44.         </tr>
  45.         <tr>
  46.             <td class="reportsubheader" width="200">IP address:</td>
  47.             <td><xsl:value-of select="@IP"/></td>
  48.         </tr>
  49.         <tr>
  50.             <td class="reportsubheader" width="200">Security report name:</td>
  51.             <td><xsl:value-of select="$FileName" /></td>
  52.         </tr>
  53.         <xsl:if test="@SUSServer and @SUSServer != ''">
  54.             <tr>
  55.                 <td class="reportsubheader" width="200">SUS Server:</td>
  56.                 <td><xsl:value-of select="@SUSServer" /></td>
  57.             </tr>
  58.         </xsl:if>
  59.         <tr>
  60.             <td class="reportsubheader" width="200">Scan date:</td>
  61.              <xsl:choose>
  62.               <xsl:when test="@LDate">
  63.                 <td><xsl:value-of select="@LDate"/></td>
  64.               </xsl:when>
  65.               <xsl:otherwise>
  66.                 <td><xsl:value-of select="@Date"/></td>
  67.               </xsl:otherwise>
  68.             </xsl:choose>        
  69.         </tr>
  70.         <xsl:if test="@MbsaToolVersion">
  71.               <tr>
  72.                 <td class="reportsubheader" width="200">Scanned with MBSA version:</td>
  73.                 <td><xsl:value-of select="@MbsaToolVersion"/>
  74.                 <xsl:if test="NewerVersions/@MbsaVer"><b>  ** Newer version <xsl:value-of select="NewerVersions/@MbsaVer"/> is available **</b></xsl:if>
  75.                 </td>
  76.             </tr>
  77.         </xsl:if>
  78.         <xsl:if test="not(@MbsaToolVersion)">
  79.               <tr>
  80.                 <td class="reportsubheader" width="200">Scanned with MBSA version: </td>
  81.                 <td>1.0    <xsl:if test="NewerVersions/@MbsaVer"><b>  ** Newer version <xsl:value-of select="NewerVersions/@MbsaVer"/> is available **</b></xsl:if>
  82.                 </td>
  83.             </tr>
  84.         </xsl:if>
  85.         <xsl:if test="@HotfixDataVersion">
  86.               <tr>
  87.                 <td class="reportsubheader" width="200">Security update database version:</td>
  88.                 <td><xsl:value-of select="@HotfixDataVersion"/>
  89.                 <xsl:if test="NewerVersions/@XmlVer"><b>  ** New security updates are available; rescan to use security update database version <xsl:value-of select="NewerVersions/@XmlVer"/> **</b></xsl:if>
  90.                 </td>
  91.             </tr>
  92.         </xsl:if>
  93.         <xsl:for-each select="//Check[@DataVersionName and @DataVersion]">
  94.               <tr>
  95.                 <td class="reportsubheader" width="200"><xsl:value-of select="@DataVersionName"/></td>
  96.                 <td><xsl:value-of select="@DataVersion"/></td>
  97.             </tr>
  98.         </xsl:for-each>
  99.         <tr>
  100.             <td class="reportsubheader" width="200">Security assessment:</td>
  101.             <td><xsl:value-of select="document('')/*/xsl:variable[@name='Assessment']/c[@score=$assess]/@text"/><xsl:text> </xsl:text>(<xsl:value-of select="document('')/*/xsl:variable[@name='Assessment']/c[@score=$assess]/@longtext"/>)</td>
  102.         </tr>
  103.         
  104.         </table>
  105.         
  106.         <!-- Security Update (hotfix) section -->
  107.         <xsl:choose>
  108.         <xsl:when test="Check[@Type='5']">
  109.             <br />
  110.             <div class="reportheader">Security Update Scan Results</div>
  111.             <br />
  112.             <xsl:choose>
  113.             <xsl:when test="Check[@Type='5'][@Cat='1']">
  114.                 <table width="100%" border="0" cellpadding="4" cellspacing="0">
  115.                     <tr class="ReportListHeader">
  116.                         <td class="ReportListHeader" style="width:40" align="center" valign="middle"><nobr>  Score  </nobr></td>
  117.                         <td class="ReportListHeader" style="width:80" align="left" valign="middle"><nobr>Issue </nobr></td>
  118.                         <td class="ReportListHeader" valign="middle"><nobr>Result </nobr></td>
  119.                     </tr>
  120.                     <xsl:for-each select=".">
  121.                         <xsl:apply-templates select="Check[@Type='5'][@Cat='1']">
  122.                             <xsl:sort order="sortorder" select="sortfield"/>
  123.                             <xsl:sort select="@Rank"/>
  124.                         </xsl:apply-templates>
  125.                     </xsl:for-each>
  126.                 </table>            
  127.             </xsl:when>
  128.             </xsl:choose>
  129.         </xsl:when>
  130.         </xsl:choose>
  131.         
  132.         
  133.         <!-- Windows (OS) section -->
  134.         <xsl:choose>
  135.         <xsl:when test="Check[@Type='1']">
  136.             <br />
  137.             <div class="reportheader">Windows Scan Results</div>
  138.             <xsl:choose>
  139.             <xsl:when test="Check[@Type='1'][@Cat='1']">
  140.                 <br />
  141.                 <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Vulnerabilities</div>
  142.                 <br />
  143.                 <table width="100%" border="0" cellpadding="4" cellspacing="0">
  144.                     <tr class="ReportListHeader">
  145.                         <td class="ReportListHeader" style="width:40" align="center" valign="middle"><nobr>  Score  </nobr></td>
  146.                         <td class="ReportListHeader" style="width:80" align="left" valign="middle"><nobr>Issue </nobr></td>
  147.                         <td class="ReportListHeader" valign="middle"><nobr>Result </nobr></td>
  148.                     </tr>
  149.                     <xsl:for-each select=".">
  150.                         <xsl:apply-templates select="Check[@Type='1'][@Cat='1']">
  151.                             <xsl:sort order="sortorder" select="sortfield"/>
  152.                             <xsl:sort select="@Rank"/>
  153.                         </xsl:apply-templates>
  154.                     </xsl:for-each>
  155.                 </table>            
  156.             </xsl:when>
  157.             </xsl:choose>
  158.             <xsl:choose>
  159.             <xsl:when test="Check[@Type='1'][@Cat='2']">
  160.                 <br />
  161.                 <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Additional System Information</div>
  162.                 <br />
  163.                 <table width="100%" border="0" cellpadding="4" cellspacing="0">
  164.                     <tr class="ReportListHeader">
  165.                         <td class="ReportListHeader" style="width:40" align="center" valign="middle"><nobr>  Score  </nobr></td>
  166.                         <td class="ReportListHeader" style="width:80" align="left" valign="middle"><nobr>Issue </nobr></td>
  167.                         <td class="ReportListHeader" valign="middle"><nobr>Result </nobr></td>
  168.                     </tr>
  169.                     <xsl:for-each select=".">
  170.                         <xsl:apply-templates select="Check[@Type='1'][@Cat='2']">
  171.                             <xsl:sort select="@Rank"/>
  172.                         </xsl:apply-templates>
  173.                     </xsl:for-each>
  174.                 </table>
  175.             </xsl:when>
  176.             </xsl:choose>
  177.         </xsl:when>
  178.         </xsl:choose>
  179.  
  180.         <!-- IIS section -->
  181.         <xsl:choose>
  182.         <xsl:when test="Check[@Type='3']">    
  183.             <br />
  184.             <div class="reportheader">Internet Information Services (IIS) Scan Results</div>
  185.             <xsl:choose>
  186.             <xsl:when test="Check[@Type='3'][@Cat='1']">
  187.                 <br />
  188.                 <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Vulnerabilities</div>
  189.                 <br />
  190.                 <table width="100%" border="0" cellpadding="4" cellspacing="0">
  191.                     <tr class="ReportListHeader">
  192.                         <td class="ReportListHeader" style="width:40" align="center" valign="middle"><nobr>  Score  </nobr></td>
  193.                         <td class="ReportListHeader" style="width:80" align="left" valign="middle"><nobr>Issue </nobr></td>
  194.                         <td class="ReportListHeader" valign="middle"><nobr>Result </nobr></td>
  195.                     </tr>
  196.                     <xsl:for-each select=".">
  197.                         <xsl:apply-templates select="Check[@Type='3'][@Cat='1']">
  198.                             <xsl:sort order="sortorder" select="sortfield"/>
  199.                             <xsl:sort select="@Rank"/>
  200.                         </xsl:apply-templates>
  201.                     </xsl:for-each>
  202.                 </table>            
  203.             </xsl:when>
  204.             </xsl:choose>
  205.             <xsl:choose>
  206.             <xsl:when test="Check[@Type='3'][@Cat='2']">
  207.                 <br />
  208.                     <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Additional System Information</div>
  209.                 <br />
  210.                 <table width="100%" border="0" cellpadding="4" cellspacing="0">
  211.                     <tr class="ReportListHeader">
  212.                         <td class="ReportListHeader" style="width:40" align="center" valign="middle"><nobr>  Score  </nobr></td>
  213.                         <td class="ReportListHeader" style="width:80" align="left" valign="middle"><nobr>Issue </nobr></td>
  214.                         <td class="ReportListHeader" valign="middle"><nobr>Result </nobr></td>
  215.                     </tr>
  216.                     <xsl:for-each select=".">
  217.                         <xsl:apply-templates select="Check[@Type='3'][@Cat='2']">
  218.                             <xsl:sort order="sortorder" select="sortfield"/>
  219.                             <xsl:sort select="@Rank"/>
  220.                         </xsl:apply-templates>
  221.                     </xsl:for-each>
  222.                 </table>
  223.             </xsl:when>
  224.             </xsl:choose>
  225.         </xsl:when>
  226.         </xsl:choose>
  227.         <xsl:choose>
  228.  
  229.         <!-- IIS Not Installed section -->
  230.         <xsl:when test="Check[@Type='3'][@Cat='4']">
  231.             <br />
  232.             <table width="100%" border="0" cellpadding="4" cellspacing="0">
  233.                     <tr class="ReportListHeader">
  234.                         <td class="ReportListHeader" style="width:40" align="center" valign="middle"><nobr>  Score  </nobr></td>
  235.                         <td class="ReportListHeader" style="width:80" align="left" valign="middle"><nobr>Issue </nobr></td>
  236.                         <td class="ReportListHeader" valign="middle"><nobr>Result </nobr></td>
  237.                     </tr>
  238.                 <xsl:for-each select=".">
  239.                     <xsl:apply-templates select="Check[@Type='3'][@Cat='4']">
  240.                         <xsl:sort order="sortorder" select="sortfield"/>
  241.                         <xsl:sort select="@Rank"/>
  242.                     </xsl:apply-templates>
  243.                 </xsl:for-each>
  244.             </table>
  245.         </xsl:when>
  246.         </xsl:choose>
  247.             
  248.  
  249.         <!-- One tag per SQL Instance, MBSA V1.1 and later -->
  250.         <xsl:choose>
  251.             <xsl:when test="SQLInstance">
  252.             <br />
  253.             <div class="reportheader">SQL Server Scan Results</div>
  254.                 <xsl:for-each select=".">
  255.                     <xsl:apply-templates select="SQLInstance"/>
  256.                 </xsl:for-each>
  257.             </xsl:when>
  258.         </xsl:choose>
  259.  
  260.  
  261.         <!-- SQL Checks, all instances, MBSA V1.0 only -->
  262.         <xsl:choose>
  263.             <xsl:when test="Check[@Type='2']">    
  264.                 <br />
  265.                 <div class="reportheader">SQL Server Scan Results</div>
  266.                 <xsl:choose>
  267.                     <xsl:when test="Check[@Type='2'][@Cat='1']">
  268.                         <br />
  269.                         <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Vulnerabilities</div>
  270.                         <br />
  271.                         <table width="100%" border="0" cellpadding="4" cellspacing="0">
  272.                             <tr class="ReportListHeader">
  273.                                 <td class="ReportListHeader" style="width:40" align="center" valign="middle"><nobr>  Score  </nobr></td>
  274.                                 <td class="ReportListHeader" style="width:80" align="left" valign="middle"><nobr>Issue </nobr></td>
  275.                                 <td class="ReportListHeader" valign="middle"><nobr>Result </nobr></td>
  276.                             </tr>
  277.                             <xsl:for-each select=".">
  278.                                 <xsl:apply-templates select="Check[@Type='2'][@Cat='1']">
  279.                                     <xsl:sort order="sortorder" select="sortfield"/>
  280.                                     <xsl:sort select="@Rank"/>
  281.                                 </xsl:apply-templates>
  282.                             </xsl:for-each>
  283.                         </table>            
  284.                     </xsl:when>
  285.                 </xsl:choose>
  286.                 <xsl:choose>
  287.                     <xsl:when test="Check[@Type='2'][@Cat='2']">
  288.                         <br />
  289.                             <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Additional System Information</div>
  290.                         <br />
  291.                         <table width="100%" border="0" cellpadding="4" cellspacing="0">
  292.                             <tr class="ReportListHeader">
  293.                                 <td class="ReportListHeader" style="width:40" align="center" valign="middle"><nobr>  Score  </nobr></td>
  294.                                 <td class="ReportListHeader" style="width:80" align="left" valign="middle"><nobr>Issue </nobr></td>
  295.                                 <td class="ReportListHeader" valign="middle"><nobr>Result </nobr></td>
  296.                             </tr>
  297.                             <xsl:for-each select=".">
  298.                                 <xsl:apply-templates select="Check[@Type='2'][@Cat='2']">
  299.                                     <xsl:sort order="sortorder" select="sortfield"/>
  300.                                     <xsl:sort select="@Rank"/>
  301.                                 </xsl:apply-templates>
  302.                             </xsl:for-each>
  303.                         </table>
  304.                     </xsl:when>
  305.                 </xsl:choose>
  306.             </xsl:when>
  307.         </xsl:choose>
  308.  
  309.  
  310.         <!-- SQL not installed -->
  311.         <xsl:choose>
  312.             <xsl:when test="Check[@Type='2'][@Cat='4']">
  313.                 <br />
  314.                 <table width="100%" border="0" cellpadding="4" cellspacing="0">
  315.                         <tr class="ReportListHeader">
  316.                             <td class="ReportListHeader" style="width:40" align="center" valign="middle"><nobr>  Score  </nobr></td>
  317.                             <td class="ReportListHeader" style="width:80" align="left" valign="middle"><nobr>Issue </nobr></td>
  318.                             <td class="ReportListHeader" valign="middle"><nobr>Result </nobr></td>
  319.                         </tr>
  320.                     <xsl:for-each select=".">
  321.                         <xsl:apply-templates select="Check[@Type='2'][@Cat='4']">
  322.                             <xsl:sort order="sortorder" select="sortfield"/>
  323.                             <xsl:sort select="@Rank"/>
  324.                         </xsl:apply-templates>
  325.                     </xsl:for-each>
  326.                 </table>
  327.             </xsl:when>
  328.         </xsl:choose>
  329.             
  330.         <!-- Desktop Section -->
  331.         <xsl:choose>
  332.         <xsl:when test="Check[@Type='4']">    
  333.             <br />
  334.             <div class="reportheader">Desktop Application Scan Results</div>
  335.             <xsl:choose>
  336.             <xsl:when test="Check[@Type='4'][@Cat='1']">
  337.                 <br />
  338.                 <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Vulnerabilities</div>
  339.                 <br />
  340.                 <table width="100%" border="0" cellpadding="4" cellspacing="0">
  341.                     <tr class="ReportListHeader">
  342.                         <td class="ReportListHeader" style="width:40" align="center" valign="middle"><nobr>  Score  </nobr></td>
  343.                         <td class="ReportListHeader" style="width:80" align="left" valign="middle"><nobr>Issue </nobr></td>
  344.                         <td class="ReportListHeader" valign="middle"><nobr>Result </nobr></td>
  345.                     </tr>
  346.                     <xsl:for-each select=".">
  347.                         <xsl:apply-templates select="Check[@Type='4'][@Cat='1']">
  348.                             <xsl:sort order="sortorder" select="sortfield"/>
  349.                             <xsl:sort select="@Rank"/>
  350.                         </xsl:apply-templates>
  351.                     </xsl:for-each>
  352.                 </table>            
  353.             </xsl:when>
  354.             </xsl:choose>
  355.             <xsl:choose>
  356.             <xsl:when test="Check[@Type='4'][@Cat='2']">
  357.                 <br />
  358.                     <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Additional System Information</div>
  359.                 <br />
  360.                 <table width="100%" border="0" cellpadding="4" cellspacing="0">
  361.                     <tr class="ReportListHeader">
  362.                         <td class="ReportListHeader" style="width:40" align="center" valign="middle"><nobr>  Score  </nobr></td>
  363.                         <td class="ReportListHeader" style="width:80" align="left" valign="middle"><nobr>Issue </nobr></td>
  364.                         <td class="ReportListHeader" valign="middle"><nobr>Result </nobr></td>
  365.                     </tr>
  366.                     <xsl:for-each select=".">
  367.                         <xsl:apply-templates select="Check[@Type='4'][@Cat='2']">
  368.                             <xsl:sort select="@Rank"/>
  369.                         </xsl:apply-templates>
  370.                     </xsl:for-each>
  371.                 </table>
  372.             </xsl:when>
  373.             </xsl:choose>
  374.         </xsl:when>
  375.         </xsl:choose>
  376.     </xsl:template>
  377.     
  378.  
  379.     <!-- SQL Instance section -->
  380.     <xsl:template match="SQLInstance">
  381.         <br />
  382.         <div class="reportsubheader" style="MARGIN-LEFT: 2px;">Instance <xsl:value-of select="@Name"/> </div>
  383.         <xsl:choose>
  384.             <xsl:when test="Check[@Type='2'][@Cat='1']">
  385.                 <br />
  386.                 <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Vulnerabilities</div>
  387.                 <br />
  388.                 <table width="100%" border="0" cellpadding="4" cellspacing="0">
  389.                     <tr class="ReportListHeader">
  390.                         <td class="ReportListHeader" style="width:40" align="center" valign="middle"><nobr>  Score  </nobr></td>
  391.                         <td class="ReportListHeader" style="width:80" align="left" valign="middle"><nobr>Issue </nobr></td>
  392.                         <td class="ReportListHeader" valign="middle"><nobr>Result </nobr></td>
  393.                     </tr>
  394.                     <xsl:for-each select=".">
  395.                         <xsl:apply-templates select="Check[@Type='2'][@Cat='1']">
  396.                             <xsl:sort order="sortorder" select="sortfield"/>
  397.                             <xsl:sort select="@Rank"/>
  398.                         </xsl:apply-templates>
  399.                     </xsl:for-each>
  400.                 </table>            
  401.             </xsl:when>
  402.         </xsl:choose>
  403.         <xsl:choose>
  404.             <xsl:when test="Check[@Type='2'][@Cat='2']">
  405.                 <br />
  406.                     <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Additional System Information</div>
  407.                 <br />
  408.                 <table width="100%" border="0" cellpadding="4" cellspacing="0">
  409.                     <tr class="ReportListHeader">
  410.                         <td class="ReportListHeader" style="width:40" align="center" valign="middle"><nobr>  Score  </nobr></td>
  411.                         <td class="ReportListHeader" style="width:80" align="left" valign="middle"><nobr>Issue </nobr></td>
  412.                         <td class="ReportListHeader" valign="middle"><nobr>Result </nobr></td>
  413.                     </tr>
  414.                     <xsl:for-each select=".">
  415.                         <xsl:apply-templates select="Check[@Type='2'][@Cat='2']">
  416.                             <xsl:sort order="sortorder" select="sortfield"/>
  417.                             <xsl:sort select="@Rank"/>
  418.                         </xsl:apply-templates>
  419.                     </xsl:for-each>
  420.                 </table>
  421.             </xsl:when>
  422.         </xsl:choose>
  423.     </xsl:template>
  424.  
  425.  
  426.  
  427.     <!-- For an individual Check -->
  428.     <xsl:template match="Check">
  429.         <xsl:param name="score" select="@Grade"/>
  430.     
  431.             <xsl:variable name="DetailURL">
  432.             <xsl:choose>
  433.                 <!-- Handle IE Zones details  -->
  434.                 <xsl:when test="@ID=118">javascript:OpenDetails('<xsl:value-of select="@ID"/>',false,true, '')</xsl:when>
  435.                 <!-- Handle hotfix details -->
  436.                 <xsl:when test="@Type=5">
  437.                     <xsl:choose>
  438.                     <xsl:when test="@Instance">javascript:OpenDetails('<xsl:value-of select="@ID"/>',true,false, '<xsl:value-of select="@Instance"/>')</xsl:when>
  439.                     <xsl:otherwise>javascript:OpenDetails('<xsl:value-of select="@ID"/>',true,false, '')</xsl:otherwise>
  440.                     </xsl:choose>
  441.                 </xsl:when>
  442.                 <!-- Handle SQL Instance details -->
  443.                 <xsl:when test="@Type=2">
  444.                     <xsl:choose>
  445.                     <xsl:when test="../../SQLInstance">javascript:OpenDetails('<xsl:value-of select="@ID"/>', false,false,'<xsl:value-of select="../@Name"/>')</xsl:when>
  446.                     <xsl:otherwise>javascript:OpenDetails('<xsl:value-of select="@ID"/>',false,false, '')</xsl:otherwise>
  447.                     </xsl:choose>
  448.                 </xsl:when>
  449.                 <!-- Handle all other details -->
  450.                 <xsl:otherwise>javascript:OpenDetails('<xsl:value-of select="@ID"/>',false,false, '')</xsl:otherwise>
  451.             </xsl:choose>
  452.             </xsl:variable>        
  453.         
  454.             <xsl:variable name="classname">
  455.             <xsl:choose>
  456.                 <xsl:when test="(position() mod 2) = 1">ReportsRowOverEven</xsl:when>
  457.                 <xsl:otherwise>ReportsRowOverOdd</xsl:otherwise>
  458.             </xsl:choose>
  459.             </xsl:variable>
  460.             <tr class="{$classname}">
  461.                 <td align="center" valign="middle">
  462.                     <xsl:choose>
  463.                       <xsl:when test="@Cat='2' and @Type!='6'">
  464.                         <xsl:choose>
  465.                           <xsl:when test="@ID='121'">
  466.                             <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@url}" />
  467.                            </xsl:when>
  468.                           <xsl:when test="@ID='10121'">
  469.                             <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@url}" />
  470.                            </xsl:when>
  471.                           <xsl:when test="@ID='101'">
  472.                             <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@url}" />
  473.                            </xsl:when>
  474.                           <xsl:when test="@ID='10101'">
  475.                             <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@url}" />
  476.                            </xsl:when>
  477.                           <xsl:otherwise>
  478.                             <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=4]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=4]/@url}" />
  479.                           </xsl:otherwise>
  480.                         </xsl:choose>
  481.                       </xsl:when>
  482.                       <xsl:when test="(@ID='178' or @ID='10178' or @ID='20178') or 
  483.                               (@ID='179' or @ID='10179' or @ID='20179')">
  484.                         <xsl:choose>
  485.                           <xsl:when test="@Grade='4'">
  486.                             <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@url}" />
  487.                           </xsl:when>
  488.                           <xsl:otherwise>
  489.                             <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@url}" />    
  490.                           </xsl:otherwise>
  491.                         </xsl:choose>
  492.                       </xsl:when>
  493.                       <xsl:otherwise>
  494.                         <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@url}" />    
  495.                       </xsl:otherwise>
  496.                     </xsl:choose>    
  497.                 </td>
  498.                 <td style="width:75">
  499.                     <TABLE width="100%">  
  500.                       <TR>
  501.                         <TD align="left"><xsl:value-of select="@Name"/></TD>
  502.                       </TR>
  503.                     </TABLE>
  504.                 </td>
  505.                 <td> 
  506.                     <TABLE width="100%">  
  507.                       <TR>
  508.                         <TD align="left" colspan="3"><xsl:value-of select="Advice"/></TD>
  509.                       </TR>
  510.                       <TR>
  511.                       <TD>
  512.                       <nobr>
  513.     
  514.                         <xsl:choose>
  515.                             <xsl:when test="$score=5 or $score=0 or $score=6 or ($score=1 and @ID < 20000)">
  516.                                 <xsl:choose>
  517.                                   <xsl:when test="@URL1 and @URL1 != '' and @URL1 != ' '">
  518.                                     <A class="sys-link-normal" style="padding: 0 0 0 0" target="_blank" href="{@URL1}">What was scanned</A>                       
  519.                                   </xsl:when>
  520.                                   <xsl:otherwise>
  521.                                                                
  522.                                   </xsl:otherwise>
  523.                                 </xsl:choose>                    
  524.                                     
  525.                                 <xsl:choose>
  526.                                   <xsl:when test="Detail">
  527.                                     <wbr/><A class="sys-link-normal" style="padding: 0 0 0 0" href="{$DetailURL}">Result details</A>    
  528.                                   </xsl:when>
  529.                                 </xsl:choose>                                                                                    
  530.                             </xsl:when>
  531.                             <xsl:otherwise>
  532.                                 <xsl:choose>
  533.                                   <xsl:when test="@URL1 and @URL1 != '' and @URL1 != ' '">
  534.                                     <A class="sys-link-normal" style="padding: 0 0 0 0" target="_blank" href="{@URL1}">What was scanned</A>                       
  535.                                   </xsl:when>
  536.                                   <xsl:otherwise>
  537.                                                                
  538.                                   </xsl:otherwise>
  539.                                 </xsl:choose>                    
  540.                                     
  541.                                 <xsl:choose>
  542.                                   <xsl:when test="Detail">
  543.                                     <wbr/><A class="sys-link-normal" style="padding: 0 0 0 0" href="{$DetailURL}">Result details</A>    
  544.                                   </xsl:when>
  545.                                   <xsl:otherwise>
  546.                                                                
  547.                                   </xsl:otherwise>
  548.                                 </xsl:choose>            
  549.                                     
  550.                                 <xsl:choose>
  551.                                   <xsl:when test="@URL2 and @URL2 != '' and @URL2 != ' '">
  552.                                     <wbr/><A class="sys-link-normal" style="padding: 0 0 0 0" target="_blank" href="{@URL2}">How to correct this</A>                       
  553.                                   </xsl:when>
  554.                                 </xsl:choose>
  555.                             </xsl:otherwise>
  556.                         </xsl:choose>
  557.                       </nobr>
  558.                       </TD>
  559.                       </TR>
  560.                     </TABLE>
  561.                 </td>
  562.             </tr>
  563.     </xsl:template>
  564.  
  565. </xsl:stylesheet>
  566.